<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多级导航</title>
    <style>
        ul {
            list-style-type: none;
        }

        .ul1 {
            width: 500px;
            height: 50px;
            border: 1px solid rgb(29, 28, 28);
            margin: 100px auto;
            padding: 0;
            text-align: center;
        }

        .li1 {
            width: 98px;
            height: 50px;
            line-height: 50px;
            margin: 0 1px;
            float: left;
            background-color: powderblue;
            position: relative;
        }

        .li1 div {
            width: 98px;
            height: 50px;
        }

        .li1:hover .ul2 {
            display: block;
        }

        .ul2 {
            position: absolute;
            top: 52px;
            left: -40px;
            display: none;
        }

        .li2 {
            width: 98px;
            height: 50px;
            background-color: rgb(172, 234, 217);
            border-bottom: 1px solid rgb(19, 20, 20);
        }
    </style>
</head>

<body>
    <div>
        <ul class="ul1">
            <li class="li1">
                <div>一级导航1</div>
                <ul class="ul2">
                    <li class="li2">二级导航1</li>
                    <li class="li2">二级导航2</li>
                    <li class="li2">二级导航3</li>
                    <li class="li2">二级导航4</li>
                    <li class="li2">二级导航5</li>
                </ul>
            </li>
            <li class="li1">
                <div>一级导航2</div>
                <ul class="ul2">
                    <li class="li2">二级导航1</li>
                    <li class="li2">二级导航2</li>
                    <li class="li2">二级导航3</li>
                    <li class="li2">二级导航4</li>
                    <li class="li2">二级导航5</li>
                </ul>
            </li>
            <li class="li1">
                <div>一级导航3</div>
                <ul class="ul2">
                    <li class="li2">二级导航1</li>
                    <li class="li2">二级导航2</li>
                    <li class="li2">二级导航3</li>
                    <li class="li2">二级导航4</li>
                    <li class="li2">二级导航5</li>
                </ul>
            </li>
            <li class="li1">
                <div>一级导航4</div>
                <ul class="ul2">
                    <li class="li2">二级导航1</li>
                    <li class="li2">二级导航2</li>
                    <li class="li2">二级导航3</li>
                    <li class="li2">二级导航4</li>
                    <li class="li2">二级导航5</li>
                </ul>
            </li>
            <li class="li1">
                <div>一级导航5</div>
                <ul class="ul2">
                    <li class="li2">二级导航1</li>
                    <li class="li2">二级导航2</li>
                    <li class="li2">二级导航3</li>
                    <li class="li2">二级导航4</li>
                    <li class="li2">二级导航5</li>
                </ul>
            </li>
        </ul>
    </div>
</body>

</html>